class BaseResult<T> {
  String code;
  String msg;
  T data;

  BaseResult({this.code, this.msg, this.data});

  static BaseResult fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    BaseResult result = BaseResult();
    result.code = '${map['code']}';
    result.msg = map['msg'];
    result.data = map['data'];
    return result;
  }

  Map<String, dynamic> toJson() => {"code": code, "message": msg, "data": data};
}
